function counter() {
    var div = document.createElement('div');
    div.innerText = '3';
    document.body.append(div);

    div.onclick = function() {
        var count = this.innerText;
        this.innerText = parseInt(count, 10) + 2;
    }
}

export default counter;